/**
 * 界面元素基类 obj = 对象元素 type = 元素类型
 */
function UiElement(obj, type) {
	this.srcObj = obj;
	this.uiEle = createElement(type || obj.type);
	this.id = obj.id;
	this.parent = obj.parentId;
	this.uiEle.id = obj.id;
	this.eventParam = function() {
	};
	initFun.call(this);
	initEvent(this, obj);
	addEle(this.parent, this.uiEle);
	return this;
}
function initFun() {
	this.del = function() {
		this.uiEle.parentNode.removeChild(ele);
	};
	this.attribute = function(name, value) {
		this.uiEle.setAttribute(name, value);
	}
	this.css = function(name, value) {
		this.uiEle.style[name] = value;
	}
	return this;
}
/**
 * 输入类型的元素
 * 
 * @param obj
 */
function Input(obj) {
	UiElement.call(this, obj, "Input");
	this.uiEle.type = obj.type;

	return this;
}
/**
 * 文本标签
 * 
 * @param obj
 */
function Label(obj) {
	UiElement.call(this, obj);
	this.attribute = function(name, value) {
		if (name == "value") {
			this.uiEle.innerText = value;
		} else {
			this.uiEle.setAttribute(name, value);
		}
	};
	return this;
}
/**
 * 简单文本框
 * 
 * @param obj
 */
function Text(obj) {
	Input.call(this, obj);
	return this;
}
/**
 * 按钮
 * 
 * @param obj
 */
function Button(obj) {
	Input.call(this, obj);
	return this;
}
/**
 * 页面--显示区域
 * 
 * @param obj
 */
function Page(obj) {
	UiElement.call(this, obj, "Div");
	return this;
}
/**
 * 布局
 * 
 * @param obj
 */
function Layout(obj) {
	UiElement.call(this, obj, "Div");
	return this;
}
/**
 * 复选框
 * 
 * @param obj
 */
function CheckBox(obj) {
	Input.call(this, obj);
	this.eventParam = function() {
		return this.uiEle.checked;
	}
	return this;
}

function DialogBox(obj) {
	this.srcObj = obj;
	this.uiEle = new MsgBox(obj.details);
	this.id = obj.id;
	this.parent = obj.parentId;
	this.uiEle.id = obj.id;
	this.eventParam = function eventParam() {
	};
	initFun.call(this);
	this.attribute = function(name, value) {
		if (value) {
			this.uiEle.show();
		}
	}
	initEvent(this, obj);
	return this;
}